home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / AMIGA / AMICUS / AMICUS05.ADF / printer / wait.asm < prev   
Assembly Source File  |  1986-01-15  |  3KB  |  91 lines

  1.  
  2. /* wait.asm AmigaLink 1/25/86 */
  3. **********************************************************************
  4. *                                                                    *
  5. *   Copyright 1985, Commodore-Amiga Inc.   All rights reserved.      *
  6. *   No part of this program may be reproduced, transmitted,          *
  7. *   transcribed, stored in retrieval system, or translated into      *
  8. *   any language or computer language, in any form or by any         *
  9. *   means, electronic, mechanical, magnetic, optical, chemical,      *
  10. *   manual or otherwise, without the prior written permission of     *
  11. *   Commodore-Amiga Incorporated, 983 University Ave. Building #D,   *
  12. *   Los Gatos, California, 95030                                     *
  13. *                                                                    *
  14. **********************************************************************
  15. *
  16. *    wait
  17. *
  18. **********************************************************************
  19.  
  20.      SECTION        printer
  21.  
  22. *------ Included Files -----------------------------------------------
  23.  
  24.      INCLUDE        "exec/types.i"
  25.      INCLUDE        "exec/ports.i"
  26.      INCLUDE        "exec/devices.i"
  27.      INCLUDE        "exec/io.i"
  28.  
  29.      INCLUDE        "devices/timer.i"
  30.      INCLUDE        "devices/prtbase.i"
  31.  
  32.      INCLUDE        "macros.i"
  33.  
  34.  
  35. *------ Imported Names -----------------------------------------------
  36.  
  37. *------ Imported Functions -------------------------------------------
  38.  
  39.      XREF_EXE  Forbid
  40.      XREF_EXE  Permit
  41.      XREF_EXE  WaitIO
  42.      XREF      _SysBase
  43.  
  44.      XREF      _PD
  45.  
  46.  
  47. *------ Exported Functions -------------------------------------------
  48.  
  49.      XDEF      _PWait
  50.  
  51.  
  52. *------ printer.device/PWait -----------------------------------------
  53. *
  54. *   NAME
  55. *    PWait - wait for a time
  56. *
  57. *   SYNOPSIS
  58. *    PWait(seconds, microseconds);
  59. *
  60. *   FUNCTION
  61. *    PWait uses the timer device to wait after writes are complete
  62. *
  63. *---------------------------------------------------------------------
  64. _PWait:
  65.           MOVEM.L   A4/A6,-(A7)
  66.           MOVE.L    _PD,A4
  67.           MOVE.L    pd_PBothReady(A4),A0
  68.           JSR  (A0)
  69.           TST.L     D0
  70.           BNE.S     error
  71.  
  72.           LEA  pd_TIOR(A4),A1
  73.           MOVE.W    #TR_ADDREQUEST,IO_COMMAND(A1)
  74.           MOVE.L    12(A7),IOTV_TIME+TV_SECS(A1)
  75.           MOVE.L    16(A7),IOTV_TIME+TV_MICRO(A1)
  76.           CLR.B     IO_FLAGS(A1)
  77.           MOVE.L    IO_DEVICE(A1),A6
  78.           JSR  DEV_BEGINIO(A6)
  79.           LINKEXE   Forbid
  80.           LEA  pd_TIOR(A4),A1
  81.           LINKEXE   WaitIO
  82.           LINKEXE   Permit
  83.           MOVEQ     #0,D0
  84.           TST.L     D0
  85. error:
  86.           MOVEM.L   (A7)+,A4/A6
  87.           RTS
  88.  
  89.           END
  90.  
  91.